-- GENERATED SPELL FOR [Archmage Allistarj] --


function spell0_7666(pUnit, Event) --@Amplify Damage,n/a--
pUnit:FullCastSpellOnTarget(12738,pUnit:GetMainTank ())
pUnit:RegisterEvent('Sorts_7666', 10346, 1)
end

function spell1_7666(pUnit, Event) --@Fire Blast,n/a--
pUnit:FullCastSpellOnTarget(14145,pUnit:GetMainTank ())
pUnit:RegisterEvent('Sorts_7666', 606, 1)
end

function spell2_7666(pUnit, Event) --@Fireball,n/a--
pUnit:FullCastSpellOnTarget(12466,pUnit:GetMainTank ())
pUnit:RegisterEvent('Sorts_7666', 3000, 1)
end

function spell3_7666(pUnit, Event) --@Frost Armor,Self--
pUnit:FullCastSpellOnTarget(12544,pUnit)
pUnit:RegisterEvent('Sorts_7666', 0, 1)
end

function spell4_7666(pUnit, Event) --@Frostbolt,Self--
pUnit:FullCastSpellOnTarget(12737,pUnit)
pUnit:RegisterEvent('Sorts_7666', 7000, 1)
end

function spell5_7666(pUnit, Event) --@Polymorph,n/a--
pUnit:FullCastSpellOnTarget(13323,pUnit:GetMainTank ())
pUnit:RegisterEvent('Sorts_7666', 9500, 1)
end

function Sorts_7666(pUnit, Event)
local choix_sorts_7666 = math.random(0, 5)
if choix_sorts_7666 == 0 then
pUnit:RegisterEvent('spell0_7666', 1, 1)
end
if choix_sorts_7666 == 1 then
pUnit:RegisterEvent('spell1_7666', 1, 1)
end
if choix_sorts_7666 == 2 then
pUnit:RegisterEvent('spell2_7666', 1, 1)
end
if choix_sorts_7666 == 3 then
pUnit:RegisterEvent('spell3_7666', 1, 1)
end
if choix_sorts_7666 == 4 then
pUnit:RegisterEvent('spell4_7666', 1, 1)
end
if choix_sorts_7666 == 5 then
pUnit:RegisterEvent('spell5_7666', 1, 1)
end
end

function mob7666_Action(pUnit, Event)
pUnit:RegisterEvent('Sorts_7666', math.random(1500, 3000), 1)
end

function mob7666_Leave(pUnit, Event)
--pUnit:RemoveEvents();--
end

function mob7666_Kill(pUnit, Event)
--pUnit:RemoveEvents();--
end

function mob7666_Die(pUnit, Event)
pUnit:RemoveEvents();
end

RegisterUnitEvent(7666, 1, 'mob7666_Action')
RegisterUnitEvent(7666, 2, 'mob7666_Leave')
RegisterUnitEvent(7666, 3, 'mob7666_Kill')
RegisterUnitEvent(7666, 4, 'mob7666_Die')
